package es.auto.test;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;

import javax.swing.JFrame;

public class JTestWindow  extends JFrame {
	private static final long serialVersionUID = -2429258645722077883L;
	private BufferedImage image;

	public JTestWindow() {	
		super("Test de BD");
		
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
	
	public JTestWindow(BufferedImage im) {	
		super("Test de BD");
		this.image = im;
		
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setSize(image.getWidth(),image.getHeight());
	}
	
	public void paint(Graphics g) {
		Graphics2D g2 = (Graphics2D)g;
		g2.drawImage(this.image, 0, 20,(ImageObserver) this);
	}
	
	public void setImage(BufferedImage im){
		this.image = im;
		this.setSize(image.getWidth(),image.getHeight());
	}
}
